
svm_dir = '/autofs/space/clive_001/users/adriana/GE_SVM';
scripts_dir = sprintf('%s/scripts', svm_dir);
%functions_dir = sprintf('%s/scripts/Functions', svm_dir);

%cd(svm_dir);

addpath(genpath(scripts_dir));
%addpath(genpath(functions_dir));

%SubjectNames = {'Subject01'}; %for more subjects use SubjectNames = {'Subject01' 'Subject02'}; etc

SubjectNames = {'GE_05','GE_06','GE_07','GE_08','GE_09','GE_10','GE_11'};
SubjectDirectories={'GE_05', 'GE_06', 'GE_07', 'GE_08', 'GE_09', 'GE_10', 'GE_11'};

nSubjects = length(SubjectNames);

% Specify the Regions of Interest ("ROIs", also called "labels":
%roiset_array = {'pMTG'};
roiset1 = 'SMG';
roiset2 = 'pMTG';
%roiset_array = {'LIFG'};
% n_roisets = length(roiset_array);

for i_subject = 1:length(SubjectNames) %for all subjects
    %i_subject = 1;
    subject = char(SubjectNames(i_subject));
    subject_dir=char(SubjectDirectories(i_subject));
    % Specify parameters
    param.brainstorm_db = sprintf('/autofs/space/clive_001/users/adriana/GE_SVM/%s',subject_dir); %directory of 'data' folder
    
    file1 = sprintf('%s/%s/epochs/%s_%s_all.mat', svm_dir, subject_dir, subject, roiset1);
    file2 = sprintf('%s/%s/epochs/%s_%s_all.mat', svm_dir, subject_dir, subject, roiset2);
    
    load(file1);
    load(file2); 
    
       
    saveFileName = sprintf('%s/%s/epochs/%s_%s_&_%s_all.mat', svm_dir, subject_dir, subject, roiset1, roiset2);
    save(saveFileName); 
end